package com.bdmc.web.controller.api.model;

import lombok.Data;

@Data
public class PoliceData {
    private String deviceid;    // 设备ID，String类型
    private float longitude;    // 经度，float类型，例如 113.24523
    private float latitude;     // 纬度，float类型，例如 22.4556
    private String lbsinfo;     // 基站信息，String类型
    private String address;     // 地址描述，String类型，URL编码后的
    private int addresstype;    // 位置类型，int类型：0=为LBS定位，1=位LBS+WIFI定位，2=gps定位
    private String name;        // 名字信息，String类型（电子围栏报警时是电子围栏的围栏名字）
    private int type;           // 报警值，int类型

    public  String getTypeText() {
        String result;
        switch (type) {
            case 2:
                result = "SOS报警";
                break;
            case 3:
                result = "电量过低";
                break;
            case 4:
                result = "跌倒报警";
                break;
            case 5:
                result = "心率超标";
                break;
            case 6:
                result = "血压超标";
                break;
            case 7:
                result = "充电器拔出";
                break;
            case 8:
                result = "久坐提醒";
                break;
            case 9:
                result = "充电器连接";
                break;
            case 10:
                result = "血糖超标";
                break;
            case 11:
                result = "设备已开机";
                break;
            case 12:
                result = "血氧超标";
                break;
            case 13:
                result = "手表已经摘除";
                break;
            case 22:
                result = "普通电话呼叫";
                break;
            case 23:
                result = "电子围栏报警-进入围栏";
                break;
            case 24:
                result = "电子围栏报警-离开围栏";
                break;
            case 25:
                result = "体温超标";
                break;
            case 36:
                result = "漏服药物";
                break;
            case 38:
                result = "手表已经佩戴";
                break;
            case 39:
                result = "检测到未配带";
                break;
            case 40:
                result = "语音\"救命\"";
                break;
            case 100:
                result = "服务号码呼叫";
                break;
            case 101:
                result = "患者咨询,请回电";
                break;
            case 102:
                result = "已签到";
                break;
            case 103:
                result = "房间里有人,活动探测仪";
                break;
            case 104:
                result = "房间里无人,活动探测仪";
                break;
            case 105:
                result = "房间开灯,活动探测仪";
                break;
            case 106:
                result = "房间关灯,活动探测仪";
                break;
            case 107:
                result = "房间有人说话,活动探测";
                break;
            case 108:
                result = "房间无人说话,活动探测";
                break;
            case 109:
                result = "房间有人走动,活动探测";
                break;
            case 110:
                result = "房间无人走动,活动探测";
                break;
            case 120:
                result = "离床";
                break;
            case 122:
                result = "上班打卡";
                break;
            case 123:
                result = "下班打卡";
                break;
            default:
                result = "未知类型";
                break;
        }
        return result;
    }

    @Override
    public String toString() {
        return "PoliceData{" +
                "deviceid='" + deviceid + '\'' +
                ", longitude=" + longitude +
                ", latitude=" + latitude +
                ", lbsinfo='" + lbsinfo + '\'' +
                ", address='" + address + '\'' +
                ", addresstype=" + addresstype +
                ", name='" + name + '\'' +
                ", type=" + type +
                '}';
    }
}
